<div class="mws-panel grid_8 students form">

    <div class="mws-panel-header">
        <span class="mws-i-24 i-table-1"><?php echo  __("Subject Fields"); ?></span>
    </div>
         <?php
if(isset($student_fields['Option']['option_value'])){//if 1
	eval( $student_fields['Option']['option_value']);
$student_fields_arr=array_filter($student_fields_arr,'strlen');

if(isset($student_fields_arr) && (is_array($student_fields_arr))  ){ //if 2 ?>  
<div class="mws-panel-body">
        <?php echo $this->Form->create('student_fields', array("class" => "mws-form")); ?>
        <div class="mws-form-inline">
 <?php  
   foreach($student_fields_arr as $key=>$value) { 
   if($key=='gender_default'){
    echo $this->Form->input($key, array('type' => "radio", "div" => "mws-form-row", "fieldset" => false, "legend" => false, "options" => array("2" => "female", "1" => "male"), "value" => $value, "before" => '<label>' .__($key). '</label><div id="mws-ui-button-radio">')) . "</div>";
   }else{
       echo $this->Form->input($key, array('type' => "radio", "div" => "mws-form-row", "fieldset" => false, "legend" => false, "options" => array("0" => "No", "1" => "yes"), "value" => $value, "before" => '<label>' .__($key). '</label><div id="mws-ui-button-radio">')) . "</div>";
   }
}
echo $this->Form->input('id',array('type'=>"hidden","value"=>$student_fields['Option']["id"]));
   //echo $this->Form->input('user_id',array("div"=>"mws-form-row","type"=>"hidden","class"=>"mws-textinput","between"=>'<div class="mws-form-item large">'));
    ?>
 </div>
	<div class="mws-button-row">
	 <input type="submit" class="mws-button orange mws-i-24 i-check large" value="<?php echo __('Submit'); ?>
">
	 </div>
<?php    //echo $this->Form->input('option_value',array("div"=>"mws-form-row","type"=>"hidden","class"=>"mws-textinput","between"=>'<div class="mws-form-item large">'));
 echo $this->Form->end(); ?>
</div>
</div>

<?php  }else{//if 2
echo __('No options in array or not defined well');}
 }else{//if 2
echo __('option name `student_fields` is missed in options table');
 }
 ?>
